<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a = [1,2,4,5,1,234,65,1,12,5,6,1,5,64,1,42,3,6,1,234,5,23];
        // 最小
        let min = a[0];
        // 最大
        let max = a[0];
        // 和
        let sum = 0;

        for (let v of a) {
            if (v < min) {
                min = v;
            }
            if (v > max) {
                max = v;
            }
            sum += v;
        }

        console.log("最小值：",min);
        console.log("最大值：",max);
        console.log("求和：", sum);
        console.log("平均值：",sum / a.length);
    </script>
</body>
</html>